Optimal. Leaf size=164 \[ \frac{9 a^2 b \sec (c+d x)}{2 d}-\frac{9 a^2 b \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac{3 a^2 b \csc ^2(c+d x) \sec (c+d x)}{2 d}+\frac{a^3 \tan (c+d x)}{d}-\frac{a^3 \cot ^3(c+d x)}{3 d}-\frac{2 a^3 \cot (c+d x)}{d}+\frac{3 a b^2 \tan (c+d x)}{d}-\frac{3 a b^2 \cot (c+d x)}{d}+\frac{b^3 \sec (c+d x)}{d}-\frac{b^3 \tanh ^{-1}(\cos (c+d x))}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.261862, antiderivative size = 164, normalized size of antiderivative = 1., number of steps used = 15, number of rules used = 8, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.276, Rules used = {2912, 2622, 321, 207, 2620, 14, 288, 270} \[ \frac{9 a^2 b \sec (c+d x)}{2 d}-\frac{9 a^2 b \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac{3 a^2 b \csc ^2(c+d x) \sec (c+d x)}{2 d}+\frac{a^3 \tan (c+d x)}{d}-\frac{a^3 \cot ^3(c+d x)}{3 d}-\frac{2 a^3 \cot (c+d x)}{d}+\frac{3 a b^2 \tan (c+d x)}{d}-\frac{3 a b^2 \cot (c+d x)}{d}+\frac{b^3 \sec (c+d x)}{d}-\frac{b^3 \tanh ^{-1}(\cos (c+d x))}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2912
Rule 2622
Rule 321
Rule 207
Rule 2620
Rule 14
Rule 288
Rule 270
Rubi steps
\begin{align*} \int \csc ^4(c+d x) \sec ^2(c+d x) (a+b \sin (c+d x))^3 \, dx &=\int \left (b^3 \csc (c+d x) \sec ^2(c+d x)+3 a b^2 \csc ^2(c+d x) \sec ^2(c+d x)+3 a^2 b \csc ^3(c+d x) \sec ^2(c+d x)+a^3 \csc ^4(c+d x) \sec ^2(c+d x)\right ) \, dx\\ &=a^3 \int \csc ^4(c+d x) \sec ^2(c+d x) \, dx+\left (3 a^2 b\right ) \int \csc ^3(c+d x) \sec ^2(c+d x) \, dx+\left (3 a b^2\right ) \int \csc ^2(c+d x) \sec ^2(c+d x) \, dx+b^3 \int \csc (c+d x) \sec ^2(c+d x) \, dx\\ &=\frac{a^3 \operatorname{Subst}\left (\int \frac{\left (1+x^2\right )^2}{x^4} \, dx,x,\tan (c+d x)\right )}{d}+\frac{\left (3 a^2 b\right ) \operatorname{Subst}\left (\int \frac{x^4}{\left (-1+x^2\right )^2} \, dx,x,\sec (c+d x)\right )}{d}+\frac{\left (3 a b^2\right ) \operatorname{Subst}\left (\int \frac{1+x^2}{x^2} \, dx,x,\tan (c+d x)\right )}{d}+\frac{b^3 \operatorname{Subst}\left (\int \frac{x^2}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{d}\\ &=\frac{b^3 \sec (c+d x)}{d}-\frac{3 a^2 b \csc ^2(c+d x) \sec (c+d x)}{2 d}+\frac{a^3 \operatorname{Subst}\left (\int \left (1+\frac{1}{x^4}+\frac{2}{x^2}\right ) \, dx,x,\tan (c+d x)\right )}{d}+\frac{\left (9 a^2 b\right ) \operatorname{Subst}\left (\int \frac{x^2}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{2 d}+\frac{\left (3 a b^2\right ) \operatorname{Subst}\left (\int \left (1+\frac{1}{x^2}\right ) \, dx,x,\tan (c+d x)\right )}{d}+\frac{b^3 \operatorname{Subst}\left (\int \frac{1}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{d}\\ &=-\frac{b^3 \tanh ^{-1}(\cos (c+d x))}{d}-\frac{2 a^3 \cot (c+d x)}{d}-\frac{3 a b^2 \cot (c+d x)}{d}-\frac{a^3 \cot ^3(c+d x)}{3 d}+\frac{9 a^2 b \sec (c+d x)}{2 d}+\frac{b^3 \sec (c+d x)}{d}-\frac{3 a^2 b \csc ^2(c+d x) \sec (c+d x)}{2 d}+\frac{a^3 \tan (c+d x)}{d}+\frac{3 a b^2 \tan (c+d x)}{d}+\frac{\left (9 a^2 b\right ) \operatorname{Subst}\left (\int \frac{1}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{2 d}\\ &=-\frac{9 a^2 b \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac{b^3 \tanh ^{-1}(\cos (c+d x))}{d}-\frac{2 a^3 \cot (c+d x)}{d}-\frac{3 a b^2 \cot (c+d x)}{d}-\frac{a^3 \cot ^3(c+d x)}{3 d}+\frac{9 a^2 b \sec (c+d x)}{2 d}+\frac{b^3 \sec (c+d x)}{d}-\frac{3 a^2 b \csc ^2(c+d x) \sec (c+d x)}{2 d}+\frac{a^3 \tan (c+d x)}{d}+\frac{3 a b^2 \tan (c+d x)}{d}\\ \end{align*}
Mathematica [A] time = 1.34271, size = 287, normalized size = 1.75 \[ \frac{\csc ^5\left (\frac{1}{2} (c+d x)\right ) \sec ^3\left (\frac{1}{2} (c+d x)\right ) \left (-8 \left (4 a^3+9 a b^2\right ) \cos (2 (c+d x))+4 \left (4 a^3+9 a b^2\right ) \cos (4 (c+d x))+3 b \left (6 \left (5 a^2+2 b^2\right ) \sin (c+d x)-2 \left (9 a^2+2 b^2\right ) \sin (2 (c+d x)) \left (\log \left (\cos \left (\frac{1}{2} (c+d x)\right )\right )-\log \left (\sin \left (\frac{1}{2} (c+d x)\right )\right )\right )-18 a^2 \sin (3 (c+d x))-9 a^2 \sin (4 (c+d x)) \log \left (\sin \left (\frac{1}{2} (c+d x)\right )\right )+9 a^2 \sin (4 (c+d x)) \log \left (\cos \left (\frac{1}{2} (c+d x)\right )\right )+12 a b-4 b^2 \sin (3 (c+d x))-2 b^2 \sin (4 (c+d x)) \log \left (\sin \left (\frac{1}{2} (c+d x)\right )\right )+2 b^2 \sin (4 (c+d x)) \log \left (\cos \left (\frac{1}{2} (c+d x)\right )\right )\right )\right )}{384 d \left (\cot ^2\left (\frac{1}{2} (c+d x)\right )-1\right )} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.099, size = 209, normalized size = 1.3 \begin{align*} -{\frac{{a}^{3}}{3\,d \left ( \sin \left ( dx+c \right ) \right ) ^{3}\cos \left ( dx+c \right ) }}+{\frac{4\,{a}^{3}}{3\,d\sin \left ( dx+c \right ) \cos \left ( dx+c \right ) }}-{\frac{8\,{a}^{3}\cot \left ( dx+c \right ) }{3\,d}}-{\frac{3\,{a}^{2}b}{2\,d \left ( \sin \left ( dx+c \right ) \right ) ^{2}\cos \left ( dx+c \right ) }}+{\frac{9\,{a}^{2}b}{2\,d\cos \left ( dx+c \right ) }}+{\frac{9\,{a}^{2}b\ln \left ( \csc \left ( dx+c \right ) -\cot \left ( dx+c \right ) \right ) }{2\,d}}+3\,{\frac{a{b}^{2}}{d\sin \left ( dx+c \right ) \cos \left ( dx+c \right ) }}-6\,{\frac{a{b}^{2}\cot \left ( dx+c \right ) }{d}}+{\frac{{b}^{3}}{d\cos \left ( dx+c \right ) }}+{\frac{{b}^{3}\ln \left ( \csc \left ( dx+c \right ) -\cot \left ( dx+c \right ) \right ) }{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.00265, size = 219, normalized size = 1.34 \begin{align*} \frac{9 \, a^{2} b{\left (\frac{2 \,{\left (3 \, \cos \left (d x + c\right )^{2} - 2\right )}}{\cos \left (d x + c\right )^{3} - \cos \left (d x + c\right )} - 3 \, \log \left (\cos \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )} + 6 \, b^{3}{\left (\frac{2}{\cos \left (d x + c\right )} - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )} - 36 \, a b^{2}{\left (\frac{1}{\tan \left (d x + c\right )} - \tan \left (d x + c\right )\right )} - 4 \, a^{3}{\left (\frac{6 \, \tan \left (d x + c\right )^{2} + 1}{\tan \left (d x + c\right )^{3}} - 3 \, \tan \left (d x + c\right )\right )}}{12 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.69274, size = 608, normalized size = 3.71 \begin{align*} -\frac{8 \,{\left (4 \, a^{3} + 9 \, a b^{2}\right )} \cos \left (d x + c\right )^{4} + 12 \, a^{3} + 36 \, a b^{2} - 12 \,{\left (4 \, a^{3} + 9 \, a b^{2}\right )} \cos \left (d x + c\right )^{2} + 3 \,{\left ({\left (9 \, a^{2} b + 2 \, b^{3}\right )} \cos \left (d x + c\right )^{3} -{\left (9 \, a^{2} b + 2 \, b^{3}\right )} \cos \left (d x + c\right )\right )} \log \left (\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) \sin \left (d x + c\right ) - 3 \,{\left ({\left (9 \, a^{2} b + 2 \, b^{3}\right )} \cos \left (d x + c\right )^{3} -{\left (9 \, a^{2} b + 2 \, b^{3}\right )} \cos \left (d x + c\right )\right )} \log \left (-\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) \sin \left (d x + c\right ) + 6 \,{\left (6 \, a^{2} b + 2 \, b^{3} -{\left (9 \, a^{2} b + 2 \, b^{3}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{12 \,{\left (d \cos \left (d x + c\right )^{3} - d \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.25716, size = 331, normalized size = 2.02 \begin{align*} \frac{a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 9 \, a^{2} b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 21 \, a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 36 \, a b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 12 \,{\left (9 \, a^{2} b + 2 \, b^{3}\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) \right |}\right ) - \frac{48 \,{\left (a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 3 \, a b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 3 \, a^{2} b + b^{3}\right )}}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 1} - \frac{198 \, a^{2} b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 44 \, b^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 21 \, a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 36 \, a b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 9 \, a^{2} b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + a^{3}}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3}}}{24 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]